

package NinetyNine;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author JOKE
 * NinetyNineMessage
 */
public class NinetyNineMessage implements Serializable {

    private int total;

    public ArrayList<String> getActiveUsernames() {
        return activeUsernames;
    }

    public void setActiveUsernames(ArrayList<String> activeUsernames) {
        this.activeUsernames = activeUsernames;
    }

    public String getCurrentPlayer() {
        return currentPlayer;
    }

    public void setCurrentPlayer(String currentPlayer) {
        this.currentPlayer = currentPlayer;
    }

    public int getCurrentUID() {
        return currentUID;
    }

    public void setCurrentUID(int currentUID) {
        this.currentUID = currentUID;
    }

    public Card getLastCardPlayed() {
        return lastCardPlayed;
    }

    public void setLastCardPlayed(Card lastCardPlayed) {
        this.lastCardPlayed = lastCardPlayed;
    }

    public String getLoser() {
        return loser;
    }

    public void setLoser(String loser) {
        this.loser = loser;
    }

    public int getNumActive() {
        return numActive;
    }

    public void setNumActive(int numActive) {
        this.numActive = numActive;
    }

    public boolean getPlaying() {
        return this.playing;
    }

    public void setPlaying(boolean playing) {
        this.playing = playing;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getTurn() {
        return turn;
    }

    public void setTurn(int turn) {
        this.turn = turn;
    }

    public String getWinner() {
        return winner;
    }

    public void setWinner(String winner) {
        this.winner = winner;
    }
    private String currentPlayer = null;
    private Card lastCardPlayed = null;
    private ArrayList<String> activeUsernames = null;
    private int numActive;
    private String winner = null;
    private String loser = null;
    private int currentUID;
    private boolean playing;
    private int turn;
    private int kicked;

    public int getKicked() {
        return kicked;
    }

    public void setKicked(int kicked) {
        this.kicked = kicked;
    }

    public NinetyNineMessage() {
        this.total = 0;
        this.currentPlayer = null;
        this.lastCardPlayed = null;
        this.activeUsernames = new ArrayList<String>();
        this.numActive = 0;
        this.winner = null;
        this.loser = null;
        this.currentUID = 0;
        this.playing = false;
        this.turn = 0;
        this.kicked = -1;
    }

    public NinetyNineMessage(int total, String currentPlayer,
            Card lastCardPlayed, ArrayList activeUsernames, int numActive,
            String winner, String loser, int currentUID, boolean playing,
            int turn) {
        this.total = total;
        this.currentPlayer = currentPlayer;
        this.lastCardPlayed = lastCardPlayed;
        this.activeUsernames = activeUsernames;
        this.numActive = numActive;
        this.winner = winner;
        this.loser = loser;
        this.currentUID = currentUID;
        this.playing = playing;
        this.turn = turn;
        this.kicked = -1;
    }

    public void reset() {
        this.total = 0;
        this.currentPlayer = null;
        this.lastCardPlayed = null;
        this.activeUsernames.clear();
        this.numActive = 0;
        this.winner = null;
        this.loser = null;
        this.currentUID = 0;
        this.playing = false;
        this.turn = 0;
        this.kicked = -1;
    }

    @Override
    public String toString() {
        String ret = "Total: "+this.total;
        ret+="\ncurrentPlayer: "+(
                this.currentPlayer!=null ? this.currentPlayer : "null");
        ret+="\nlastCardPlayed: "+(
                this.lastCardPlayed!=null ? this.lastCardPlayed : "null");
        ret+="\nactiveUsernames: "+(
                this.activeUsernames!=null ? this.activeUsernames : "null");
        ret+="\nnumActive: "+this.numActive;
        ret+="\nwinner: "+(this.winner!=null ? this.winner : "null");
        ret+="\nlose: "+(this.loser!=null ? this.loser : "null");
        ret+="\ncurrentUID: "+this.currentUID;
        ret+="\nplaying: "+this.playing;
        ret+="\nturn: "+this.turn;
        return ret;
    }
}
